<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<div id="navbarAffix" class="navbar-static-top" data-spy="affix">
	<div class="container">
		<a class="navbar-brand" href="${ctx}/dashboard"></a>
		<ul class="navbar-nav">
			<!--
			<li ><a href="${ctx}/">首页</a></li>
			-->
			<shiro:notAuthenticated>
			<li><a href="${ctx}/register">注册</a></li>
			<li><a href="${ctx}/login">登录</a></li>
			</shiro:notAuthenticated>
			<!--
			<li class="active"><a href="#">移动</a></li>
			<li><a href="#">指南</a></li>
			-->
		</ul>
		<shiro:authenticated>
		<ul class="navbar-nav navbar-nav-right">
			<li class="dropdown">
				<a href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">组织设置 <i class="fa fa-angle-down" aria-hidden="true"></i></a>
				<ul class="dropdown-menu">
					<li><a href="${ctx}/group/create">创建社会团体</a></li>
					<c:if test="${group != null}">
						<li class="divider"><span class="label">${group.name}</span></li>
						<li><a href="${ctx}/group/setAdminPage?groupCode=${group.groupCode}">管理员设置</a></li>
						<li><a href="${ctx}/group/update?groupCode=${group.groupCode}">修改社会团体信息</a></li>
						<!--
						<li><a href="${ctx}/group/joinOrg">挂靠上级组织</a></li>
						-->
						<c:if test="${fn:length(groups)>1}">
						<li class="divider"><span class="label">切换其他组织</span></li>
						<c:forEach items="${groups}" var="item">
							<c:if test="${item.groupCode != group.groupCode}">
							<li><a href="${ctx}/dashboard?groupCode=${item.groupCode}">${item.name}</a></li>
							</c:if>
						</c:forEach>
						</c:if>
					</c:if>
				</ul>
			</li>
			<li class="dropdown">
				<a href="#" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">系统设置 <i class="fa fa-angle-down" aria-hidden="true"></i></a>
				<ul class="dropdown-menu">
					<li><a href="${ctx}/settings/certification">完善个人信息</a></li>
					<li><a href="${ctx}/settings/changePwd">修改密码</a></li>
					<li><a href="${ctx}/settings/changeMobile">更换手机</a></li>
					<!--
					<li><a href="${ctx}/group/create?groupCode=${group.groupCode}">意见反馈</a></li>
					-->
					<li><a href="${ctx}/logout">退出</a></li>
				</ul>
			</li>
		</ul>
		</shiro:authenticated>
	</div>
</div>